using Script;
using UnityEngine;
using UnityEngine.UI;

public class IndentUI : BaseUI
{
    public Text words;

    private LaMianIndent _laMianIndent;

    protected override void OnInit(params object[] args)
    {
        
    }

    protected override void OnDispose()
    {
        
    }

    protected override void OnOpen(params object[] args)
    {
        _laMianIndent = (LaMianIndent)args[0];
        
        UpdateShow();
    }

    protected override void OnClose()
    {
        
    }

    private void UpdateShow()
    {
        string peiCaiStr = "";
        foreach (var peiCai in _laMianIndent.peiCais)
        {
            Debug.Log("p = " + peiCai);
            peiCaiStr += Constent.PeiCaiNameDic[(EPeiCai)peiCai] + ",";
        }

        words.text =
            $"我要这样的拉面：\n" +
            $"软硬度：{Constent.RuanYingDuNameDic[_laMianIndent.ruanYingDu]}\n" +
            $"高汤：{Constent.GaoTangNameDic[_laMianIndent.gaoTang]}\n" +
            $"调味料：{Constent.TiaoWeiLialDic[_laMianIndent.tiaoWeiLiao]}\n" +
            $"调味度：{Constent.TiaoWeiDolDic[_laMianIndent.tiaoWeiDu]}\n" +
            $"配料：{peiCaiStr}";
    }

}
